package com.example.houduan.demos.web.mapper;

import com.example.houduan.demos.web.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserMapper {


    @Select("select * from houduan.user")
    List<User> findAll();

    @Select("select smscode from houduan.user where tel = #{phone}")
    User getSmsCode(String phone);

    @Update("update houduan.user set tel = #{phone} where smscode = #{code}")
    void updatePhone(@Param("phone")String phone, @Param("code")String code);
}
